package sorting;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Mafer
 */
public class Compare implements Comparable
{
    private String firstElement, secondElement;
    
    
    public int compareTo(Object valor){
        int result;
        
        String numero1 = ((Compare)valor).getFirstElement();
        String numero2 = ((Compare)valor).getSecondElement();
        if (firstElement.equals(numero1))
            result = numero1.compareTo(firstElement);
        else
            result = numero2.compareTo(secondElement);
        return result;
    }

    /**
     * @return the firstElement
     */
    public String getFirstElement() {
        return firstElement;
    }

    /**
     * @return the secondElement
     */
    public String getSecondElement() {
        return secondElement;
    }
    
}
